package com.fbs.demo1114.service.impl;



import com.fbs.demo1114.service.BookShopService;
import com.fbs.demo1114.service.Carshier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CarshierImpl implements Carshier {
    @Autowired
    private BookShopService bookShopService;

    @Transactional
    public void buy(List<String> isbns, String username) {

        for (String isbn : isbns) {
            bookShopService.purchase(isbn, username);
        }
    }
}
